// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import App from "./App";
import router from "./router";
import {
  ImagePreview,
  Button,
  NavBar,
  Grid,
  GridItem,
  Image,
  Field,
  Uploader,
  Dialog,
  Popup,
  Icon,
  Toast
} from "vant";
import VueI18n from "vue-i18n";
import axios from "axios";
import md5 from "js-md5";
Vue.prototype.$md5 = md5;
Vue.prototype.axios = axios;

//多语言
Vue.use(VueI18n);
const i18n = new VueI18n({
  locale: "zh",
  messages: {
    zh: require("./i18n/lang/zh"),
    en: require("./i18n/lang/en"),
    pt: require("./i18n/lang/pt-PT"),
    es: require("./i18n/lang/es"),
    fr: require("./i18n/lang/fr"),
    de: require("./i18n/lang/de"),
    ru: require("./i18n/lang/ru"),
    th: require("./i18n/lang/th"),
    vi: require("./i18n/lang/vi"),
    ja: require("./i18n/lang/ja"),
    id: require("./i18n/lang/id")
  }
});

Vue.use(ImagePreview);
Vue.use(Button);
Vue.use(NavBar);
Vue.use(Grid);
Vue.use(GridItem);
Vue.use(Image);
Vue.use(Field);
Vue.use(Uploader);
Vue.use(Dialog);
Vue.use(Popup);
Vue.use(Icon);
Vue.use(Toast);
Vue.config.productionTip = false;

Vue.prototype.$ImagePreview = ImagePreview;

/* eslint-disable no-new */
new Vue({
  el: "#app",
  router,
  i18n,
  components: { App },
  template: "<App/>"
});
